#ifndef CORE_CONF_H
#define CORE_CONF_H

#include <pcap.h>

#include "task_manager.h"
#include "db_info.h"
#include "serversocket_conf.h"

#define DB_CONFIGURE_MAX_LEN 512
#define DB_SUPPORT_MAX_NUM 8

struct core_conf {
	char *core_conf_file;

	unsigned char old_mode;
	int old_mode_argc;
	char **old_mode_argv;
	char *old_mode_core_path;

	int pcap_mode;
	char *pcap_file;
	char *pcap_interface;
	pcap_t *pcap_handle;
	int pcap_datalink_type;

	struct core_data_queue *core_data_queue;
	unsigned long max_id;	
	unsigned int mode;	

	struct task_manager *task_manager;

	int usleep_time;

	int use_mm;
	unsigned long mm_limit;

	int use_mail;
	char *to;

	struct db_info *db_info;
	char db_config[DB_SUPPORT_MAX_NUM][DB_CONFIGURE_MAX_LEN];
	int db_count;
	
	struct serversocket_conf * server_conf;
	int s;
	struct sockaddr_in *addr;
};

enum core_conf_index {
	CORE_CONF_FILE = 0,
	OLD_MODE = 1,
	OLD_MODE_ARGC = 2,
	OLD_MODE_ARGV = 3,
	OLD_MODE_CORE_PATH = 4,

	PCAP_MODE = 5,
	PCAP_FILE = 6,
	PCAP_INTERFACE = 7,

	USLEEP_TIME = 8,

	USE_MM = 9,
	MM_LIMIT = 10,

	MAX_ID = 11,
	MODE = 12,

	USE_MAIL = 13,
	TO = 14,

	DB_CONF = 15,

	END_OF_CORE_CONF_INDEX,
};

#endif
